from PIL import Image
import os.path
def img_resize(img_file, path_save, width,height):
    img = Image.open(img_file)
    new_image = img.resize((width,height),Image.BILINEAR)
    new_image.save(os.path.join(path_save,os.path.basename(img_file)))

img_resize('./gragh/3.png', './',28,28)